<template>
	<view>
		<!-- 行业选择器 -->
		<u-picker :show="messageInfo.zpqzshow" keyName="name" :columns="columns" @confirm="confirm" @cancel="cancel"></u-picker>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		name:"zhaopinqzpicker",
		props:{
			messageInfo:{
				zpqzshow:false,
				value:1,//value1招聘，2求职
			}
		},
		data() {
			return {
				columns: [],
			};
		},
		created(){
			this.init()
		},
		watch:{
			'messageInfo.value'(newval){
				this.columns=[]
				this.init()
			}
		},
		methods:{
			init(){
				httpRequest.request('/api/zp/zpItem', 'GET', {
					type:this.messageInfo.value
				}, false, false, true).then(res => {
					if (res.code == 1) {
						this.columns.push(res.data)
					}
				})
			},
			confirm(e){
				let data = {
					name:e.value[0].name,
					id:e.value[0].id,
					value:this.messageInfo.value
				}
				this.$emit("surezpqz",data)
				this.$parent.zpqzshow = false
			},
			cancel(){
				this.$parent.zpqzshow = false
			}
		}
		
	}
</script>

<style>

</style>